/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package graphics;

import java.awt.Image;
import java.awt.image.BufferedImage;
import java.awt.image.RescaleOp;
import javax.swing.ImageIcon;
import javax.swing.JLabel;

/**
 *
 * @author asmaa
 */
public class BrightnessIncrease {
    /*
     * This class used to change image brightness
     */
    public static void imageBrightness(float factor,JLabel c, BufferedImage image) {
        float[] factors = new float[] {
            factor, factor, factor, factor
        };
        float[] offsets = new float[] {
            0.0f, 0.0f, 0.0f, 0.0f
        };
        RescaleOp op = new RescaleOp(factors, offsets, null);
        BufferedImage brighter = op.filter(image, null);
        c.setIcon(new ImageIcon(brighter.getScaledInstance(120, 25, Image.SCALE_AREA_AVERAGING)));
    }
}
